/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sdc.utility;

import java.lang.reflect.Field;

/**
 *
 * @author yokoe
 */
public class TestUtility<V>
{

	public V getField(String fieldName, Object instance)
	{
		Field field;
		V fieldObject = null;

		try
		{
			field = instance.getClass().getDeclaredField(fieldName);

			field.setAccessible(true);

			fieldObject = (V) field.get(instance);
		} catch (NoSuchFieldException e)
		{
			e.printStackTrace();
		} catch (IllegalAccessException e)
		{
			e.printStackTrace();
		} catch (RuntimeException e)
		{
			e.printStackTrace();
		}


		return fieldObject;
	}
}
